<?php

namespace App\Models\Attendance;

use App\Models\User;
use App\Models\Attendance;
use Illuminate\Database\Eloquent\Model;

/**
 * 申诉数据模型
 *
 * Date: 2018/6/22
 * @author George
 * @package App\Models\Attendance
 */
class Appeal extends Model
{
	/**
	 * 定义可批量填充字段
	 *
	 * @var array
	 * Date: 19/03/2018
	 * @author George
	 */
	protected $guarded = ['id'];

	/**
	 * 获取申述人信息
	 *
	 * Date: 2018/6/26
	 * @author George
	 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
	 */
	public function user()
	{
		return $this->belongsTo(User::class, 'user_id', 'id');
	}

	/**
	 * 获取申述的考勤信息
	 *
	 * Date: 2018/6/26
	 * @author George
	 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
	 */
	public function attendance()
	{
		return $this->belongsTo(Attendance::class, 'attendance_id', 'id');
	}
}
